import {
  Controller,
  Get,
  Post,
  Body,
  Query,
  Header,
  UseGuards,
  Request,
} from '@nestjs/common';
import { RouteService } from './route.service';
import { AuthGuard } from '@nestjs/passport';

// @UseGuards(AuthGuard('jwt'))
@Controller('route')
export class RouteController {
  constructor(private readonly routeService: RouteService) {}
  
  @Get('/getRouteList')
  async getRouteList(@Query() param) {
    return await this.routeService.getRouteList(param);
  }
  @Post('/getRouteTreeList')
  async getRouteTreeList(@Body() param) {
    return await this.routeService.getRouteTreeList(param);
  }
  @Get('/getRouteTree')
  async getRouteTree(@Query() param) {
    return await this.routeService.getRouteTree(param);
  }
  @Get('/getRoute')
  async getRoute(@Query() param) {
    return await this.routeService.getRoute(param);
  }
  @Post('/saveRoute')
  async saveRoute(@Body() param) {
    return await this.routeService.saveRoute(param);
  }
    //批量删除角色
    @Post('/delRouteList')
    async delRouteList(@Body() param) {
      return await this.routeService.delRouteList(param);
    }
}
